package com.github.kotvertolet.youtubejextractor.models.newModels;

import com.google.gson.annotations.SerializedName;
import ohos.utils.Parcel;
import ohos.utils.Sequenceable;

import java.io.Serializable;

/**
 * 类功能描述(类上)
 *
 * @author AnBetter
 * @since 2021-04-15
 */
public class AtrUrl implements Sequenceable, Serializable {
    @SerializedName("baseUrl")
    private String baseUrl;

    @SerializedName("elapsedMediaTimeSeconds")
    private int elapsedMediaTimeSeconds;

    public static final Sequenceable.Producer<AtrUrl> CREATOR = new Producer<AtrUrl>() {
        @Override
        public AtrUrl createFromParcel(Parcel parcel) {
            // Initialize an instance first, then do customized unmarshlling.
            AtrUrl atrUrl = new AtrUrl();
            atrUrl.unmarshalling(parcel);
            return atrUrl;
        }
    };

    @Override
    public boolean marshalling(Parcel parcel) {
        parcel.writeString(this.baseUrl);
        parcel.writeInt(this.elapsedMediaTimeSeconds);
        return true;
    }

    @Override
    public boolean unmarshalling(Parcel parcel) {
        this.baseUrl=parcel.readString();
        this.elapsedMediaTimeSeconds=parcel.readInt();
        return true;
    }

    @Override
    public String toString() {
        return "AtrUrl{" +
                "baseUrl = '" + baseUrl + '\'' +
                ",elapsedMediaTimeSeconds = '" + elapsedMediaTimeSeconds + '\'' +
                "}";
    }

    public String getBaseUrl() {
        return baseUrl;
    }

    public void setBaseUrl(String baseUrl) {
        this.baseUrl = baseUrl;
    }

    public int getElapsedMediaTimeSeconds() {
        return elapsedMediaTimeSeconds;
    }

    public void setElapsedMediaTimeSeconds(int elapsedMediaTimeSeconds) {
        this.elapsedMediaTimeSeconds = elapsedMediaTimeSeconds;
    }
}
